package com.treetao.union.db.service.impl;

import com.treetao.union.db.model.MallPSkuAttrItem;
import com.treetao.union.db.mapper.MallPSkuAttrItemMapper;
import com.treetao.union.db.service.MallPSkuAttrItemService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * SKU-属性关系 服务实现类
 * </p>
 *
 * @author Dev.M
 * @since 2020-04-11
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MallPSkuAttrItemServiceImpl extends ServiceImpl<MallPSkuAttrItemMapper, MallPSkuAttrItem> implements MallPSkuAttrItemService {

	@Override
	public List<MallPSkuAttrItem> getSkuAttrItems(Long skuId) {
		if(skuId==null) return null;
		QueryWrapper<MallPSkuAttrItem> q = new QueryWrapper<MallPSkuAttrItem>();
		q.eq("ref_sku_id", skuId);
		return list(q);
	}

}
